package imgshare.mapper;

import imgshare.model.Follow;
import imgshare.model.FollowKey;
import imgshare.model.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface FollowMapper {
    int deleteByPrimaryKey(FollowKey key);

    int insert(FollowKey record);

    Follow selectByPrimaryKey(FollowKey key);

    int updateByPrimaryKeySelective(Follow record);

    int updateByPrimaryKey(Follow record);

    List<User> selectBeFollowedUsersBySubjectId(Integer userId);

    /**
     * 给前端服务器存储在vuex中实现动态用户关注名单
     * @param userId 主体id
     * @return 主体所关注的用户id列表
     */
    List<Integer> selectBeFollowedUsersIdBySubjectId(Integer userId);
}